package com.dmp.onlinestore.model.service.base;

import java.util.List;

import com.dmp.onlinestore.model.dto.ProductBean;
import com.dmp.onlinestore.model.service.*;

import com.dmp.onlinestore.model.service.impl.CatalogImpl;
import com.dmp.onlinestore.model.service.impl.ProductBeanPagerImpl;



public class ServiceFactory {
	
	private static ServiceFactory instance = null;
		
	// Hide the constructor.
	private ServiceFactory () {
	}

	public static ServiceFactory instance() {
		if (instance == null) {
			instance = new ServiceFactory();
		}
		return instance;
	}
	
	// Allocates an instance of a Catalog service object.
	public Catalog getCatalog() {
		return new CatalogImpl();
	}

	
	// Allocates a product bean pager. Requires a list of ProductBeans to operate on.
	public ProductBeanPager getProductBeanPager(List<ProductBean> prodList) {
		return new ProductBeanPagerImpl(prodList);
	}
	
}
